<?php
	include '../ini.php';
	include "../../libraries/xl_hoa_don.php";
	include "../../libraries/xl_bo_dem.php";
	include '../../libraries/my_pager.php';
	$dt_phan_trang=new my_pager;
	$dt_xl_hoa_don = new xl_hoa_don;
	$dt_xl_bo_dem = new xl_bo_dem;
	
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<?php include'../widgets/js_css.php'?>
</head>
<body>
<div id="body-wrapper"> <!-- Wrapper for the radial gradient background -->
  
  <?php include '../widgets/sidebar.php'?>
  <div id="main-content"> <!-- Main Content Section with everything -->
  <!--noscript-->
    <!-- Page Head --> 
    <!-- End .shortcut-buttons-set -->
    
    <div class="clear"></div>
    <!-- End .clear -->
    
    <div class="content-box"><!-- Start Content Box -->
      
      <div class="content-box-header">
        <h3>Danh sách đơn hàng</h3>
        <div class="clear"></div>
      </div>
      <!-- End .content-box-header -->
      
      <div class="content-box-content">
        <div class="tab-content default-tab" id="tab1"> <!-- This is the target div. id must match the href of this div's tab -->
          <?php thong_bao()?>
          <form action="../../../hieu_sach/admin/don_hang/xoa_nhieu.php" method="post" name="f_loai_bv">
          <table>
            <thead>
              <tr>
                  <th style="text-align:center !important">Mã</th>
                  <th style="text-align:center !important">Mã đơn hàng</th>
                  <th style="text-align:center !important">Họ Tên</th>
                  <th style="text-align:center !important">Ngày Tạo</th>
                  <th style="text-align:center !important">Tổng tiền (VNĐ)</th>
                  <th style="text-align:center !important">Trạng Thái</th>
              </tr>
            </thead>
            <tfoot>
              <tr>
                <td colspan="3">
                  <div class="pagination">
                    <?php
						 $tong_so_sp=$dt_xl_hoa_don->so_luong();
                        $tong_so_trang=$dt_phan_trang->tong_so_trang($tong_so_sp,ADMIN_LIMIT);
                        if($tong_so_sp > ADMIN_LIMIT)
							echo $dt_phan_trang->xuat_phan_trang_admin($_GET['page'],$tong_so_trang);
                    ?>
                  </div>
                  <!-- End .pagination -->
                  
                  <div class="clear"></div></td>
              </tr>
            </tfoot>
            <tbody>
              <?php
			  	$vi_tri=$dt_phan_trang->vi_tri(ADMIN_LIMIT);
			  	$ds_hoa_don=$dt_xl_hoa_don->danh_sach($vi_tri,ADMIN_LIMIT);
				foreach($ds_hoa_don as $hoa_don)
				{
			  ?>
              
                <tr>
                  <td style="text-align:center !important"><?php echo $hoa_don['ma']?></td>
                  <td style="text-align:center !important"><strong><a title="Xem chi tiết" href="chi_tiet.php?ma=<?php echo $hoa_don['ma_hd']?>"><?php echo $hoa_don['ma_hd']?></a></strong></td>
                  <td style="text-align:center !important" class="ho_ten_nguoi_mua"><?php echo $hoa_don['ho_ten']?></td>
                  <td style="text-align:center !important" class="ngay_tao"><?php echo $hoa_don['ngay_tao']?></td>
                  <td style="text-align:center !important" class="tong_tien"><?php echo $hoa_don['tong_tien']?></td>
                  <td style="text-align:center !important" class="trang_thai"><a href="cap_nhat_tt.php?ma=<?php echo $hoa_don['ma_hd']?>" title="Cập nhật trạng thái"><?php 
					if($hoa_don['trang_thai']==0) echo "Đơn hàng đã chấp nhận";
					if($hoa_don['trang_thai']==1) echo "Đã thanh toán và đang giao hàng";
					if($hoa_don['trang_thai']==2) echo "Đang giao hàng và nhận tiền thanh toán";
					if($hoa_don['trang_thai']==3) echo "Đã giao hàng";
				  ?></a></td>
                </tr>
               <?php }?> 
              </tbody>
          </table>
          </form>
        </div>
        <!-- End #tab1 --> 
        
      </div>
      <!-- End .content-box-content --> 
      
    </div>
    <!-- End .content-box -->
    
    <div class="clear"></div>
    <div id="footer"> <small> <!-- Remove this notice or replace it with whatever you want --> 
    <!-- End #footer --> 
    
  </div>
  <!-- End #main-content --> 
</div>
</body>
</html>
